package com.xmall.product.define.constants;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Data
@Component
@RefreshScope
public class ProductProperties {

    /**
     * 库存锁定检查延时时间，单位毫秒
     */
    @Value("${product.stockLockCheckMilliseconds}")
    private Integer stockLockCheckMilliseconds = 60000;

    /**
     * 库存扣减日志cron
     */
    @Value("${product.stockDeductLogRetryCron}")
    private String stockDeductLogRetryCron = "0 0/5 * * * ?";

    /**
     * 库存恢复日志cron
     */
    @Value("${product.stockRevertLogRetryCron}")
    private String stockRevertLogRetryCron = "0 0/5 * * * ?";

    /**
     * 商品数据全量同步cron
     */
    @Value("${product.fullProductUpdateSyncCron}")
    private String fullProductUpdateSyncCron = "0 0/30 * * * ?";

    /**
     * 商品数据全量同步cron
     */
    @Value("${product.fullProductDeleteSyncCron}")
    private String fullProductDeleteSyncCron = "0 0/30 * * * ?";

    /**
     * 商品数据全量同步分页数量
     */
    @Value("${product.fullProductSyncPageSize}")
    private Integer fullProductSyncPageSize = 1000;

    /**
     * 商品数据全量同步每次睡眠时间
     */
    @Value("${product.fullProductSyncSleepSeconds}")
    private Integer fullProductSyncSleepSeconds = 5;

}
